import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional } from 'class-validator';

export class ListUserDto {
  @ApiProperty({ description: '角色id', example: 4 })
  @IsOptional()
  roleId?: null | number;

  @ApiProperty({
    description: '账号（邮箱格式）',
    example: 'niunai@niunai.com',
  })
  @IsOptional()
  account?: null | string;

  @ApiProperty({ description: '用户名', example: '牛奶' })
  @IsOptional()
  username?: null | string;

  @ApiProperty({ description: '账号id', example: 1 })
  @IsOptional()
  id?: null | number;

  @ApiProperty({ description: '页码', example: 1 })
  @IsNotEmpty({ message: 'pageNum不能为空' })
  pageNum: number = 1;

  @ApiProperty({ description: '每页查询数量', example: 10 })
  @IsNotEmpty({ message: 'pageSize不能为空' })
  pageSize: number = 10;
}
